package com.gdzn.signal.controller;


import com.gdzn.common.core.domain.R;
import com.gdzn.common.core.utils.JsonUtil;
import com.gdzn.signal.service.IDevCabinetService;
import com.gdzn.system.api.RemoteUserService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/dev" )
public class DevCabinetTestController {

    @Autowired
    private IDevCabinetService devCabinetService;


    @PostMapping("/save")
    public R add2(@RequestBody String jsonStr) {
        Map paramMap = JsonUtil.toMap(jsonStr);
        if("110".equals(paramMap.get("msgType").toString()) || "111".equals(paramMap.get("msgType").toString())){

        }
        if("310".equals(paramMap.get("msgType").toString()) || "311".equals(paramMap.get("msgType").toString())){
            devCabinetService.saveOrUpdateCabinetInfo(jsonStr);
        }
        if("410".equals(paramMap.get("msgType").toString()) || "411".equals(paramMap.get("msgType").toString())){

        }
        if("500".equals(paramMap.get("msgType").toString()) || "501".equals(paramMap.get("msgType").toString())){

        }
        if("210".equals(paramMap.get("msgType").toString()) || "211".equals(paramMap.get("msgType").toString())){

        }
        return R.ok();
    }

}
